import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from "@/views/LoginView";
import FindPass from "@/views/FindPass";
import RegistView from "@/views/RegistView";
import OrderView from "@/views/OrderView";
import GroceryView from "@/views/GroceryView";
import TheOrderView from "@/views/TheOrderView";
import MyView from "@/views/MyView";
import MainView from "@/views/MainView";
import OrderDetail from "@/views/OrderDetail";
import AddAddressView from "@/views/AddAddressView";
import AddressListView from "@/views/AddressListView";
import EditAddressView from "@/views/EditAddressView";
import Detail from "@/views/Detail";
import ShopBag from "@/views/Shopbag";
import IntegralView from "@/views/IntegralView";
import MyInformationView from "@/views/MyInformationView";
import MapView from "@/views/MapView";

const routes = [
  {
    path: '/',
    name: 'main',
    component: MainView,
    meta:{
      TabBarShow: false,
    }
  },
  {
    path: '/myInform',
    name: 'myInform',
    component: MyInformationView,
    meta:{
      TabBarShow: false,
    }
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    meta:{
      TabBarShow: true,
    }
  },
  {
    path: '/myInform',
    name: 'myInform',
    component: MyInformationView,
    meta:{
      TabBarShow: false,
    }
  },
  {
    path: '/orderDetail',
    name: 'orderDetail',
    component: OrderDetail,
    meta:{
      TabBarShow: true,
    }
  },
  {
    path: '/integral',
    name: 'integral',
    component: IntegralView,
    meta:{
      TabBarShow: false,
    }
  },
  {
    path: '/login',
    name: 'login',
    component: LoginView,
    meta:{
      TabBarShow: false,
    }
  },
  {
    path: '/find',
    name: 'find',
    component: FindPass,
    meta:{
      TabBarShow: false,
    }
  },
  {
    path: '/regist',
    name: 'regist',
    component: RegistView,
    meta:{
      TabBarShow: false,
    }
  },
  {
    path: '/order',
    name: 'order',
    component: OrderView,
    meta:{
      TabBarShow: true,
    }
  },
  {
    path: '/integral',
    name: 'integral',
    component: IntegralView,
    meta:{
      TabBarShow: true,
    }
  },
  {
    path: '/grocery',
    name: 'grocery',
    component: GroceryView,
    meta:{
      TabBarShow: true,
    }
  },
  {
    path: '/theOrder',
    name: 'theOrder',
    component: TheOrderView,
    meta:{
      TabBarShow: true,
    }
  },
  {
    path: '/my',
    name: 'my',
    component: MyView,
    meta:{
      TabBarShow: true,
    }
  },
  {
    path: '/addAddress',
    name: 'addAddress',
    component: AddAddressView,
    meta:{
      TabBarShow: false,
    }
  },
  {
    path: '/addressList',
    name: 'addressList',
    component: AddressListView,
    meta:{
      TabBarShow: false,
    }
  },
  {
    path: '/editAddress',
    name: 'editAddress',
    component: EditAddressView,
    meta:{
      TabBarShow: false,
    }
  },
  {
    path: '/map',
    name: 'map',
    component: MapView,
    meta:{
      TabBarShow: false,
    }
  },
  {
    path: '/integral',
    name: 'integral',
    component: IntegralView,
    meta:{
      TabBarShow: false,
    }
  },
  {
    path: '/detail/:id',
    name: 'Detail',
    component:Detail
  },{
    path: '/shopBag',
    name: 'shopBag',
    component: ShopBag
  },
  {
    path: '/orderbuy',
    name: 'OrderBuy',
    component: () => import('../views/OrderBuy.vue')
  },

]

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
